package com.schoolvisitors.response;

import lombok.Getter;

@Getter
public enum ResultCode {
    UNKNOWN_ERROR(500, "服务器错误"),
    SUCCESS(200, "成功"),
    //其他状态
    USER_NOT_EXIST(2001, "用户不存在"),
    USERNAME_IS_USE(2002, "用户名称已被使用"),
    PHONE_IS_USE(2003, "手机号已被使用"),
    ID_NUMBER_IS_USE(2004, "身份证号已被使用"),
    USER_NOT_FOUND(2005, "用户不存在"),
    CUBICLE_NUMBER_IS_USE(2006, "隔间号码已被使用"),
    ADMIN_USERNAME_IS_USE(2007, "管理员名称已被使用" ),
    FLOOR_NAME_IS_USE(2008, "楼层名称已被使用" ),
    FLOOR_NUMBER_IS_USE(2009, "楼层号码已被使用" ),
    CUBICLE_IS_RESERVATION(2010, "隔间当前时段已被预约"),
    CANCEL_RESERVATION_TIMEOUT(2011, "取消预约超时, 不返还积分"),
    NOT_AVAILABLE(2012, "未开放预约"),

    NOT_PERMISSION(403, "无权限操作"),

    ROOM_NUMBER_ALREADY_EXISTS(4005, "房间号已存在"),
    FLOOR_ID_NOT_FOUND(4006, "楼层序号不存在"),
    ROOM_NOT_FOUND(4007, "房间不存在"),
    ROLE_NOT_FOUND(4008, "角色不存在"),
    ADMIN_NOT_FOUND(4009, "管理员不存在"),
    CUBICLE_NOT_FOUNT(4010, "隔间不存在"),
    TIME_SLOT_CONFLICT(4011,"时间段存在冲突"),
    TIME_SLOT_NOT_FOUND(4012, "时间段不存在"),
    RESERVATION_NOT_FOUND(4013, "预约不存在"),
    RESERVATION_IS_REJECTED(4014, "预约不通过" ),
    USER_INSUFFICIENT_POINTS(4015, "积分不足" ),
    RESERVATION_IS_SIGNED_IN(4016, "预约已签到"),
    RESERVATION_NOT_SIGNED_IN(4016, "预约未签到"),
    RESERVATION_IS_SIGNED_OUT(4017, "预约已签退"),
    USER_NOT_REGISTER(4018, "用户未注册" ),
    REGISTER_VERIFY_FAIL(4019, "注册验证失败" ),
    NO_RESERVATION_FOUND(4020, "没有匹配的预约" ),
    USER_IS_REVIEWED(4021, "用户已审核过" ),
    USER_NOT_RESERVATION_PERMISSION(4022, "用户没有预约权限"),
    INSTRUMENT_NOT_FOUND(4023, "仪器不存在"),
    INSTRUMENT_IS_RESERVED(4024, "仪器被预约"),
    TIME_SLOT_EXPIRED(4025, "不能预约过去的时间段"),
    CANNOT_CANCEL_AFTER_START(4026, "预约已开始"),
    SYSTEM_CONFIG_NOT_FOUNT(4027, "配置项不存在"),
    RESERVATION_IS_PENDING(4028, "预约在审核中"),
    RESERVATION_DAY_EXCEEDED(4029, "预约日期超出限制"),
    USERNAME_OR_PASSWORD_ERROR(4030, "用户名或密码错误"),
    ALREADY_CHECKED_IN(4031,"已经签到过"),
    ALREADY_CHECKED_OUT(4032,"已经签退过"),
    NOT_CHECKED_IN(4033, "没有签到过"),
    NOT_CHECKED_IN_TIME(4034, "不在可签到时间"),
    NOT_CHECKED_OUT_TIME(4034, "不在可签退时间"),

    CUBICLE_COUNT_CANNOT_BE_MODIFIED(4036, "隔间数量不能修改"),

    FILE_EMPTY(4036, "文件为空"),
    FILE_TYPE_ERROR(4037, "只支持 JPG/PNG/WEBP 格式"),
    FILE_TOO_LARGE(4038, "图片大小不能超过2MB"),
    INSTRUMENT_LOAN_NOT_FOUND(4039, "仪器借还不存在" ),
    INSTRUMENT_LOAN_REVIEWED(4040, "已审核过"),

    INSTRUMENT_LOAN_NOT_REVIEW(4041, "未审核通过"),
    INSTRUMENT_LOAN_NOT_STATUS(4042,"不在对应状态" ),

    ROLE_HAS_RESOURCE(4043, "角色已有此资源权限" ),
    FILE_UPLOAD_ERROR(5001, "上传失败"), REVIEWER_NOT_FOUND(4044, "审核人不存在"),
    REVIEWER_NOT_PERMISSION(4055, "审核人没有权限"),
    START_END_TIME_EQUAL(4056, "开始和结束时间不能相同"),
    PASSWORD_NOT_FOUND(4057, "密码不能为空"), FLOOR_HAS_ROOMS(4058, "还有房间属于该楼层"),
    ADMIN_HAS_ROLE(4059, "还有管理员属于该角色"), INSTRUMENT_SUB_TYPE_HAS_INSTRUMENT(4060, "还有仪器属于该类型" );

    private final int code;
    private final String message;

    ResultCode(Integer code, String message){
        this.code = code;
        this.message = message;
    }
}
